package com.aaa.controller.sds;

import com.aaa.controller.BaseController;
import com.aaa.entity.Result;

import com.aaa.entity.sds.ViewTestResultSdsTotal;
import com.aaa.service.sds.ViewTestResultSdsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;

/**
 * @author ：Teacher马（2508531326@qq.com）
 * @date ：Created in 2022/9/5 16:22
 * @description：
 * @modified By：
 * @version:
 */
@RestController
@RequestMapping("SdsLastController")
public class SdsLastController extends BaseController {
    @Autowired
    ViewTestResultSdsService viewTestResultSdsService;

    @RequestMapping("queryAll.do")
    public Result queryAll(){
        List<ViewTestResultSdsTotal> viewTestResultSdsTotals = viewTestResultSdsService.queryAllSds();
        for (ViewTestResultSdsTotal viewTestResultSdsTotal : viewTestResultSdsTotals) {
            return success(viewTestResultSdsTotal);

        }
        return fail();
    }

    @RequestMapping("sdsLast.do")
    public ModelAndView sdsLast(ModelAndView modelAndView){
        modelAndView.setViewName("sds/sdsLast");
        return  modelAndView;
    }
}
